package com.sy.bean;

import org.springframework.context.annotation.DependsOn;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Component
//@Lazy
@Scope("singleton")
//@Scope("prototype")
@DependsOn("b")
public class A {
    public A() {
        System.out.println("A实例化...");
    }

    @PostConstruct
    public void init() {
        System.out.println("A初始化...");
    }

    @PreDestroy
    public void destroy() {
        System.out.println("A销毁...");
    }

}
